Skip to content

Comments

[3.x] UPD deprecated getQuery(true)#311

Closed
tkuschel wants to merge 1 commit intojoomla-framework:3.x-devfrom
tkuschel:3.x-dev
Closed

[3.x] UPD deprecated getQuery(true)#311
tkuschel wants to merge 1 commit intojoomla-framework:3.x-devfrom
tkuschel:3.x-dev

Conversation

@tkuschel
Copy link

@tkuschel tkuschel commented Sep 8, 2024

I am currently in the process of replacing the obsolete function getQuery(true) with createQuery() in Joomla CMS, see joomla/joomla-cms#42344 (work in progress, at the meantime it is a closed PR, but open again after testing here).
To make my life easier, I have added the interface to the database with the createQuery() on the one hand, on the other hand you can use a little trick to build in a backtrace in the output via trigger_deprecated(), so that with the help (I use code OSS under Linux Arch) of the debugger (DEBUG CONSOLE) you can immediately jump to the calling file. See attached screenshot.
Screenshot from 2024-09-08 09-22-00

The former deprecated message was also very unclear and I have reworded it.
Perhaps other deprecated messages can also be modified accordingly?

Summary of Changes

  1. Rewording of debug message for deprecation of getQuery() with $new parameter.
  2. Add the function createQuery() to the DatabaseInterface, also comment the deprecation there.

Testing Instructions

Debug messages at the DEBUG CONSOLE or log file for Deprecated API in Joomla CMS.

Documentation Changes Required

I don't know if this is not already sufficiently documented.

@HLeithner
Copy link
Contributor

Changing the Interface can't be done in 3.x, also the call to $this->getQuery(true); can't be changed here because it would also be a b/c break.

So this has to be moved to 4.0

@tkuschel
Copy link
Author

tkuschel commented Sep 8, 2024

Can we add the printing backtrace file only? - for 3.x -- this is a great help when debugging

@HLeithner
Copy link
Contributor

Not sure if this is a great idea, mainly for performance reasons, getting the stacktrace for each query call in production doesn't sounds great for me.

@tkuschel
Copy link
Author

tkuschel commented Sep 8, 2024

You are right performance decreases, when dealing with that, I can manually include that code during the replacements in my code.
I'll keep that PR as reminder, you may close.

@HLeithner
Copy link
Contributor

I keep this open and added it to the next framework maintainers meeting.

@HLeithner
Copy link
Contributor

Move Interface change to 4.0 and don't change the deprecation message using backtrace.

@richard67 richard67 changed the title UPD deprecated getQuery(true) [3.x] UPD deprecated getQuery(true) Mar 30, 2025
@Hackwar
Copy link
Contributor

Hackwar commented Jun 25, 2025

Thank you for your work. With the work in #325, this change here isn't exactly necessary anymore. I'm sorry that it took this long. I'm closing this PR.

@Hackwar Hackwar closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants